package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	g := gin.Default()
	g.GET("/", GetResult)
	g.Run()
}
func GetResult(g *gin.Context) {
	arr := make([]Student1, 0)
	var student Student1
	student.Name = "胡琪"
	student.Sex = "男"
	student.Age = 22
	arr = append(arr, student)
	var student1 Student1
	student1.Name = "胡琪"
	student1.Sex = "男"
	student1.Age = 22
	arr = append(arr, student1)
	g.JSON(http.StatusOK, arr)

}

type Student1 struct {
	Name string `json:"name"`
	Age  int    `json:"age"`
	Sex  string `json:"sex"`
}
